package org.bmind.datasword.config.dto;

import java.util.ArrayList;
import java.util.Collection;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import org.bmind.datasword.utils.EqualsUtil;
import org.bmind.datasword.utils.HashCodeUtil;
import org.bmind.datasword.utils.StorageUtilities;


@XmlRootElement
public class DMultiAnalisysContainer extends DObjIdentity{
	static { StorageUtilities.addREngineType(DMultiAnalisysContainer.class); }
	private int fHashCode;
	
	private Collection<DMultiAnalisys> dMultiAnalisys = new ArrayList<DMultiAnalisys>();

	public DMultiAnalisysContainer() {super();}

	public Collection<DMultiAnalisys> getdMultiAnalisys() {return dMultiAnalisys;}
	@XmlElement
	public void setdMultiAnalisys(Collection<DMultiAnalisys> dMultiAnalisys) {this.dMultiAnalisys = dMultiAnalisys;}
	
	/* (non-Javadoc)
     * @see org.bmind.datasword.config.dto.DObjCommon#equals(java.lang.Object)
     */
    @Override
    public boolean equals(Object obj) {
        if ( this == obj ) return true;
 	    if ( !(obj instanceof DMultiAnalisys) ) return false;
 	   
 	   DMultiAnalisysContainer dMuc = (DMultiAnalisysContainer)obj;
 	    
     	return	EqualsUtil.areEqual(this.dMultiAnalisys, dMuc.dMultiAnalisys) ;
    }

	/* (non-Javadoc)
     * @see org.bmind.datasword.config.dto.DObjCommon#hashCode()
     */
	@Override
	public int hashCode() {
		
		// this style of lazy initialization is
		// suitable only if the object is immutable
		if (fHashCode == 0) {
		int result = HashCodeUtil.SEED;
			result = HashCodeUtil.hash(result, dMultiAnalisys);
		
			fHashCode = result;
		}
		return fHashCode;
	}
}
